package configcenter.zookeeper.curator.api.retry;


import common.model.MagicUrl;
import configcenter.zookeeper.curator.api.FailbackRegistry;
import remoting.timer.Timeout;

/**
 * FailedUnregisteredTask
 */
public final class FailedUnregisteredTask extends AbstractRetryTask {

    private static final String NAME = "retry unregister";

    public FailedUnregisteredTask(MagicUrl url, FailbackRegistry registry) {
        super(url, registry, NAME);
    }

    @Override
    protected void doRetry(MagicUrl url, FailbackRegistry registry, Timeout timeout) {
        registry.doUnregister(url);
        registry.removeFailedUnregisteredTask(url);
    }
}
